package com.pengxun.manager.enums;

public enum UploadFilePathEnum {

    DEFAULT(0,"/copton","默认地址"),
    COMPANY_LOGO(1,"/copton/companyLogo","公司logo"),
    COMPANY_BUSINESS_LICENSE(2,"/copton/businessLicense","公司营业执照"),
    USER_HEAD(3,"/copton/userHead","用户头像");



    private Integer type;
    private String path;
    private String desc;


    UploadFilePathEnum(Integer type, String path, String desc) {
        this.type = type;
        this.path = path;
        this.desc = desc;
    }

    public static String getPath(Integer type){
        if (type == null){
            return UploadFilePathEnum.DEFAULT.path;
        }
        for(UploadFilePathEnum uploadFilePathEnum:UploadFilePathEnum.values()) {
            if(uploadFilePathEnum.getType().equals(type)) {
                return uploadFilePathEnum.getPath();
            }
        }

        return UploadFilePathEnum.DEFAULT.path;

    }


    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
